import requset from '@/utils/request'

// 获取文章列表数据
export const getArticleList = ({ pagenum, pagesize, cate_id, state }) => {
  return requset.get('/my/article/list', {
    params: {
      pagenum,
      pagesize,
      cate_id,
      state
    }
  })
}

// 发表文章接口
export const userPublishArticle = (data) => {
  return requset.post('/my/article/add', data)
}

// 删除文章接口
export const userDelArticle = (id) => {
  return requset.delete('/my/article/info', {
    params: {
      id
    }
  })
}

// 获取文章详情接口
export const userGetArticleInfo = (id) => {
  return requset.get('/my/article/info', {
    params: {
      id
    }
  })
}

// 根据id修改文章详情接口
export const userEditArticle = (data) => {
  return requset.put('/my/article/info', data)
}
